package com.tools.sqlmaker.make.impl;

import com.tools.sqlmaker.entry.OrgInfo;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: zhoubin
 * @date: 2023/9/7
 */
public class NodeInfoSqlMaker extends GatewayBaseMaker {

    public NodeInfoSqlMaker(OrgInfo orgInfo) {
        super(orgInfo);
    }

    @Override
    public List<Map<String, Object>> getParamList() {

        Map<String, Object> map = makeDefaultMap();
        map.put("node_code", getNodeCode());
        map.put("node_name", getNodeCode() + "业务系统");
        map.put("unit_code", getUnitCode());

        return new ArrayList<Map<String, Object>>() {{
            add(map);
        }};
    }

    @Override
    protected Map<String, Object> makeDefaultMap() {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("id", idMake());
        map.put("node_code", null);
        map.put("node_name", null);
        map.put("node_type", "O");
        map.put("node_status", "0");
        map.put("route_mode", "M");
        map.put("unit_code", null);
        map.put("rule_set_code", null);
        map.put("is_encrypt", "1");
        map.put("encrypt_type", null);
        return map;
    }

    @Override
    protected String getTableName() {
        return "t_ccgw_node_info";
    }

}
